// 例子39

let o = {
    name: 'Tom',
    age: '18'
}
for (let key of Object.keys(o)) {
    console.log([key, o[key]]); // 前后分别输出["name", "Tom"] ["age" "18"]
}